package ycl.important.controller.msg;

import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ycl.important.common.ApiResult;
import ycl.important.common.base.controller.BaseController;
import ycl.important.entity.msg.TheMsg;
import ycl.important.service.msg.TheMsgService;

import javax.annotation.Resource;

/**
 * 消息
 *
 * @author: YCL
 * @date: 2021-08-23 21:08:43
 */
@RestController
@RequestMapping("/hovel/the-msg")
@Api(tags = "消息")
@ApiSort(26)
public class TheMsgController extends BaseController {


	@Resource
	private TheMsgService theMsgService;

	@Override
	public ApiResult<TheMsg> getById(Long id) {
		return ApiResult.success(theMsgService.getById(id));
	}

	@GetMapping("/read")
	public ApiResult<T> read(Long userId){
		theMsgService.readBatch(userId);
		return ApiResult.success();
	}
}
